//
//  ProductNormalCell.m
//  loveKangaroo
//
//  Created by 趣看 on 15/3/4.
//  Copyright (c) 2015年 SeeKool Inc. All rights reserved.
//

#import "ProductNormalCell.h"

@implementation ProductNormalCell
{
    //商品的数量和价格
    int product_count;
    float product_price;
    
    //备注和位置
    NSString *remork;
    NSString *location;
    
}
@synthesize product = _product;
@synthesize indexPath = _indexPath;



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:NO animated:animated];

    // Configure the view for the selected state
}

- (void)addleftPanGesture
{
    UISwipeGestureRecognizer *left = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(leftPan)];
    
    left.direction = UISwipeGestureRecognizerDirectionLeft;
    
    [_leftView addGestureRecognizer:left];
}

- (void)leftPan
{
    
    _btnX.constant  = 100;
   
    [self setNeedsUpdateConstraints];
    [UIView animateWithDuration:0.35f animations:^{
        [self layoutIfNeeded];
    }];
}

//减1
- (IBAction)delection:(id)sender
{
}
//加1
- (IBAction)add:(id)sender {
}


//获取当前的位置
- (IBAction)position:(id)sender {
}
//备注
- (IBAction)remarks:(id)sender {
}

//确认修改
- (IBAction)changeAction:(id)sender {

    
    //修改的那些东西都要放着

    if ([_delegate respondsToSelector:@selector(changeProduct:withIndexPath:)])
    {
        [_delegate changeProduct:self.product withIndexPath:self.indexPath];
    }
}

//买不到
- (IBAction)buyNothing:(id)sender {
    
    
}

//买到了
- (IBAction)bought:(id)sender {
    
    _leftSpace.constant  = -[UIScreen mainScreen].bounds.size.width -8;
    _rightSpace.constant = [UIScreen mainScreen].bounds.size.width -8;
    [self setNeedsUpdateConstraints];
    [UIView animateWithDuration:0.35f animations:^{
        [self layoutIfNeeded];
    }];

}


@end
